﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="manageGamePlay.aspx.cs" Inherits="WebRole1.manageGamePlay" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table border="2">
<tr>
<td class="style1" colspan="3">
    Current Session:<asp:GridView ID="GridView4" runat="server" 
        AutoGenerateColumns="False" DataKeyNames="sessionID" 
        DataSourceID="SqlDataSource4">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="sessionID" HeaderText="sessionID" 
                InsertVisible="False" ReadOnly="True" SortExpression="sessionID" />
            <asp:BoundField DataField="patientID" HeaderText="patientID" 
                SortExpression="patientID" />
            <asp:BoundField DataField="exeID" HeaderText="exeID" SortExpression="exeID" />
            <asp:BoundField DataField="dateofplay" HeaderText="dateofplay" 
                SortExpression="dateofplay" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbConnection %>" 
        DeleteCommand="DELETE FROM [session] WHERE [sessionID] = @sessionID" 
        InsertCommand="INSERT INTO [session] ([patientID], [exeID], [dateofplay]) VALUES (@patientID, @exeID, @dateofplay)" 
        SelectCommand="SELECT * FROM [session]" 
        UpdateCommand="UPDATE [session] SET [patientID] = @patientID, [exeID] = @exeID, [dateofplay] = @dateofplay WHERE [sessionID] = @sessionID">
        <DeleteParameters>
            <asp:Parameter Name="sessionID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="patientID" Type="Decimal" />
            <asp:Parameter Name="exeID" Type="Int32" />
            <asp:Parameter Name="dateofplay" Type="DateTime" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="patientID" Type="Decimal" />
            <asp:Parameter Name="exeID" Type="Int32" />
            <asp:Parameter Name="dateofplay" Type="DateTime" />
            <asp:Parameter Name="sessionID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </td>
</tr>
<tr>
<td class="style1" colspan="3">
    &nbsp;</td>
</tr>
<tr>
<td class="style1" colspan="3">
    Create Session<asp:FormView ID="FormView2" runat="server" 
        DataKeyNames="sessionID" DataSourceID="SqlDataSource4" DefaultMode="Insert">
        <EditItemTemplate>
            sessionID:
            <asp:Label ID="sessionIDLabel1" runat="server" 
                Text='<%# Eval("sessionID") %>' />
            <br />
            patientID:
            <asp:TextBox ID="patientIDTextBox" runat="server" 
                Text='<%# Bind("patientID") %>' />
            <br />
            exeID:
            <asp:TextBox ID="exeIDTextBox" runat="server" Text='<%# Bind("exeID") %>' />
            <br />
            dateofplay:
            <asp:TextBox ID="dateofplayTextBox" runat="server" 
                Text='<%# Bind("dateofplay") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            patientID:
            <asp:TextBox ID="patientIDTextBox" runat="server" 
                Text='<%# Bind("patientID") %>' />
            <br />
            exeID:
            <asp:TextBox ID="exeIDTextBox" runat="server" Text='<%# Bind("exeID") %>' />
            <br />
            dateofplay:
            <asp:TextBox ID="dateofplayTextBox" runat="server" 
                Text='<%# Bind("dateofplay") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            sessionID:
            <asp:Label ID="sessionIDLabel" runat="server" Text='<%# Eval("sessionID") %>' />
            <br />
            patientID:
            <asp:Label ID="patientIDLabel" runat="server" Text='<%# Bind("patientID") %>' />
            <br />
            exeID:
            <asp:Label ID="exeIDLabel" runat="server" Text='<%# Bind("exeID") %>' />
            <br />
            dateofplay:
            <asp:Label ID="dateofplayLabel" runat="server" 
                Text='<%# Bind("dateofplay") %>' />
            <br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Edit" />
            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                CommandName="Delete" Text="Delete" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="New" />
        </ItemTemplate>
    </asp:FormView>
    </td>
</tr>
<tr>
<td class="style1" colspan="3">
    &nbsp;</td>
</tr>
<tr>
<td class="style1" colspan="3">
    Current GamePlay<asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" DataKeyNames="uid" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="uid" HeaderText="uid" InsertVisible="False" 
                ReadOnly="True" SortExpression="uid" />
            <asp:BoundField DataField="sessionID" HeaderText="sessionID" 
                SortExpression="sessionID" />
            <asp:BoundField DataField="stageID" HeaderText="stageID" 
                SortExpression="stageID" />
            <asp:BoundField DataField="specialInstructions" HeaderText="specialInstructions" 
                SortExpression="specialInstructions" />
            <asp:BoundField DataField="joint" HeaderText="joint" 
                SortExpression="joint" />
            <asp:BoundField DataField="gameKey" HeaderText="gameKey" 
                SortExpression="gameKey" />
            <asp:BoundField DataField="gameValue" HeaderText="gameValue" 
                SortExpression="gameValue" />
            <asp:BoundField DataField="other1" HeaderText="other1" 
                SortExpression="other1" />
            <asp:BoundField DataField="other2" HeaderText="other2" 
                SortExpression="other2" />
            <asp:BoundField DataField="other3" HeaderText="other3" 
                SortExpression="other3" />
            <asp:BoundField DataField="other4" HeaderText="other4" 
                SortExpression="other4" />
            <asp:BoundField DataField="other5" HeaderText="other5" 
                SortExpression="other5" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbConnection %>" 
        DeleteCommand="DELETE FROM [gamePlay] WHERE [uid] = @uid" 
        InsertCommand="INSERT INTO [gamePlay] ([patientID], [exeID], [dateofplay], [roundtime], [points]) VALUES (@patientID, @exeID, @dateofplay, @roundtime, @points)" 
        SelectCommand="SELECT * FROM [gamePlay]" 
        UpdateCommand="UPDATE [gamePlay] SET [sessionID] = @sessionID, [stageID] = @stageID, [specialInstructions] = @specialInstructions, [joint] = @joint, [gameKey] = @gameKey, [gameValue] =@gameValue WHERE [uid] = @uid">
        <DeleteParameters>
            <asp:Parameter Name="uid" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="patientID" Type="Decimal" />
            <asp:Parameter Name="exeID" Type="Int32" />
            <asp:Parameter Name="dateofplay" Type="DateTime" />
            <asp:Parameter Name="roundtime" Type="Decimal" />
            <asp:Parameter Name="points" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="sessionID" Type="Int32" />
            <asp:Parameter Name="stageID" Type="Int32" />
            <asp:Parameter Name="specialInstructions" Type="String" />
            <asp:Parameter Name="joint" Type="String" />
            <asp:Parameter Name="gameKey" Type="String" />
            <asp:Parameter Name="gameValue" Type="Decimal" />
            <asp:Parameter Name="uid" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </td>
</tr>
<tr>
<td class="style1" colspan="3">
    Create GamePlay <br />
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="uid" 
        DataSourceID="SqlDataSource1" DefaultMode="Insert">
        <EditItemTemplate>
            uid:
            <asp:Label ID="uidLabel1" runat="server" Text='<%# Eval("uid") %>' />
            <br />
            sessionID:
            <asp:TextBox ID="sessionIDTextBox" runat="server" 
                Text='<%# Bind("sessionID") %>' />
            <br />
            stageID:
            <asp:TextBox ID="stageIDTextBox" runat="server" Text='<%# Bind("stageID") %>' />
            <br />
            specialInstructions:
            <asp:TextBox ID="specialInstructionsTextBox" runat="server" 
                Text='<%# Bind("specialInstructions") %>' />
            <br />
            joint:
            <asp:TextBox ID="jointTextBox" runat="server" 
                Text='<%# Bind("joint") %>' />
            <br />
            gameKey:
            <asp:TextBox ID="gameKeyTextBox" runat="server" 
                Text='<%# Bind("gameKey") %>' />
            <br />
            gameValue:
            <asp:TextBox ID="gameValueTextBox" runat="server" 
                Text='<%# Bind("gameValue") %>' />
            <br />
            other1:
            <asp:TextBox ID="other1TextBox" runat="server" Text='<%# Bind("other1") %>' />
            <br />
            other2:
            <asp:TextBox ID="other2TextBox" runat="server" 
                Text='<%# Bind("other2") %>' />
            <br />
            other3:
            <asp:TextBox ID="other3TextBox" runat="server" 
                Text='<%# Bind("other3") %>' />
            <br />
            other4:
            <asp:TextBox ID="other4TextBox" runat="server" 
                Text='<%# Bind("other4") %>' />
            <br />
            other5:
            <asp:TextBox ID="other5TextBox" runat="server" 
                Text='<%# Bind("other5") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>
        <InsertItemTemplate>
            sessionID:
            <asp:TextBox ID="sessionIDTextBox" runat="server" 
                Text='<%# Bind("sessionID") %>' />
            <br />
            stageID:
            <asp:TextBox ID="stageIDTextBox" runat="server" Text='<%# Bind("stageID") %>' />
            <br />
            specialInstructions:
            <asp:TextBox ID="specialInstructionsTextBox" runat="server" 
                Text='<%# Bind("specialInstructions") %>' />
            <br />
            joint:
            <asp:TextBox ID="jointTextBox" runat="server" 
                Text='<%# Bind("joint") %>' />
            <br />
            gameKey:
            <asp:TextBox ID="gameKeyTextBox" runat="server" 
                Text='<%# Bind("gameKey") %>' />
            <br />
            gameValue:
            <asp:TextBox ID="gameValueTextBox" runat="server" 
                Text='<%# Bind("gameValue") %>' />
            <br />
            other1:
            <asp:TextBox ID="other1TextBox" runat="server" Text='<%# Bind("other1") %>' />
            <br />
            other2:
            <asp:TextBox ID="other2TextBox" runat="server" 
                Text='<%# Bind("other2") %>' />
            <br />
            other3:
            <asp:TextBox ID="other3TextBox" runat="server" 
                Text='<%# Bind("other3") %>' />
            <br />
            other4:
            <asp:TextBox ID="other4TextBox" runat="server" 
                Text='<%# Bind("other4") %>' />
            <br />
            other5:
            <asp:TextBox ID="other5TextBox" runat="server" 
                Text='<%# Bind("other5") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
        <ItemTemplate>
            uid:
            <asp:Label ID="uidLabel" runat="server" Text='<%# Eval("uid") %>' />
            <br />
            sessionID:
            <asp:Label ID="sessionIDLabel" runat="server" Text='<%# Bind("sessionID") %>' />
            <br />
            stageID:
            <asp:Label ID="stageIDLabel" runat="server" Text='<%# Bind("stageID") %>' />
            <br />
            specialInstructions:
            <asp:Label ID="specialInstructionsLabel" runat="server" 
                Text='<%# Bind("specialInstructions") %>' />
            <br />
            joint:
            <asp:Label ID="jointLabel" runat="server" Text='<%# Bind("joint") %>' />
            <br />
            gameKey:
            <asp:Label ID="gameKeyLabel" runat="server" 
                Text='<%# Bind("gameKey") %>' />
            <br />
            gameValue:
            <asp:Label ID="gameValueLabel" runat="server" Text='<%# Bind("gameValue") %>' />
            <br />
            other1:
            <asp:Label ID="other1Label" runat="server" Text='<%# Bind("other1") %>' />
            <br />
            other2:
            <asp:Label ID="other2Label" runat="server" Text='<%# Bind("other2") %>' />
            <br />
            other3:
            <asp:Label ID="other3Label" runat="server" Text='<%# Bind("other3") %>' />
            <br />
            other4:
            <asp:Label ID="other4Label" runat="server" Text='<%# Bind("other4") %>' />
            <br />
            other5:
            <asp:Label ID="other5Label" runat="server" Text='<%# Bind("other5") %>' />
            <br />
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Edit" />
            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                CommandName="Delete" Text="Delete" />
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="New" />
        </ItemTemplate>
    </asp:FormView>
    <br />
</td>
</tr>
<tr>
<td class="style1">
    Current Patient</td>
<td>
    &nbsp;</td>
<td>
    Current EXE</td>
</tr>
<tr>
<td class="style1">
    <asp:GridView ID="GridView2" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" DataKeyNames="uid" DataSourceID="SqlDataSource2">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="uid" HeaderText="uid" InsertVisible="False" 
                ReadOnly="True" SortExpression="uid" />
            <asp:BoundField DataField="LastName" HeaderText="LastName" 
                SortExpression="LastName" />
            <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                SortExpression="FirstName" />
            <asp:BoundField DataField="doctor" HeaderText="doctor" 
                SortExpression="doctor" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbConnection %>" 
        DeleteCommand="DELETE FROM [patient] WHERE [uid] = @uid" 
        InsertCommand="INSERT INTO [patient] ([LastName], [FirstName], [doctor]) VALUES (@LastName, @FirstName, @doctor)" 
        SelectCommand="SELECT [uid], [LastName], [FirstName], [doctor] FROM [patient]" 
        UpdateCommand="UPDATE [patient] SET [LastName] = @LastName, [FirstName] = @FirstName, [doctor] = @doctor WHERE [uid] = @uid">
        <DeleteParameters>
            <asp:Parameter Name="uid" Type="Decimal" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="FirstName" Type="String" />
            
            <asp:Parameter Name="doctor" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="FirstName" Type="String" />
            
            <asp:Parameter Name="doctor" Type="String" />
            <asp:Parameter Name="uid" Type="Decimal" />
        </UpdateParameters>
    </asp:SqlDataSource>
</td>
<td>
    &nbsp;</td>
<td>
    &nbsp;&nbsp;
    <asp:GridView ID="GridView3" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" DataKeyNames="uid" 
        DataSourceID="SqlDataSource3" Width="220px">
        <Columns>
            <asp:BoundField DataField="uid" HeaderText="uid" InsertVisible="False" 
                ReadOnly="True" SortExpression="uid" />
            <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
            <asp:BoundField DataField="path" HeaderText="path" SortExpression="path" />
            <asp:BoundField DataField="description" HeaderText="description" 
                SortExpression="description" />
            <asp:BoundField DataField="exeType" HeaderText="exeType" 
                SortExpression="exeType" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:dbConnection %>" 
        SelectCommand="SELECT * FROM [exe]">
    </asp:SqlDataSource>
</td>
</tr>
</table>
</asp:Content>
